package com.naiterui.ehp.bs.b2c.order.fegin;

import com.naiterui.ehp.bp.bo.patient.MsgMaPublishParamBO;
import com.naiterui.ehp.bp.bo.patient.MsgPublishBO;
import com.naiterui.ehp.bp.bo.patient.PatientBO;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "b2cAp", url = "${ehp.domain.ap}", configuration = FeignConfiguration.class)
public interface IPatientFeignClient {

    @RequestMapping("inner/patient/base")
    PatientBO getBaseInfo(@RequestParam("patientId") Long patientId) throws BusinessException;

    /**
     * 小程序消息
     * @param publishParamBO
     * @return
     */
    @Async
    @PostMapping("/inner/message/ma/publish")
    MsgPublishBO publishMaMessage(@RequestBody MsgMaPublishParamBO publishParamBO);

}
